//
//  SearchRow0TableViewCell.m
//  miaopai
//
//  Created by duyifang on 15/11/19.
//  Copyright © 2015年 Crow Zhang. All rights reserved.
//

#import "SearchRow0TableViewCell.h"

@interface SearchRow0TableViewCell ()

@property(nonatomic, retain) UILabel *hotLabel;

@property(nonatomic, retain) UIButton *nextButton;

@end

@implementation SearchRow0TableViewCell

- (void)dealloc
{
    [_hotLabel release];
    [_nextButton release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.hotLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_hotLabel];
        [_hotLabel release];
        
        self.nextButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_nextButton addTarget:self action:@selector(changeData) forControlEvents:UIControlEventTouchUpInside];
        [self.contentView addSubview:_nextButton];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    _hotLabel.frame = CGRectMake(20, 5, 150, 30);
    _hotLabel.text = @"24小时热搜";
    
    _nextButton.frame = CGRectMake(self.frame.size.width - 80, _hotLabel.frame.origin.y, 60, _hotLabel.frame.size.height);
    [_nextButton setTitle:@"换一批" forState:UIControlStateNormal];
    [_nextButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
}

- (void)changeData
{
    [self.delegate changeTableViewData];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
